package com.uliky.shouyiLibrary.product.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration  //声明配置类
@EnableTransactionManagement    //开启事务
@MapperScan("com.uliky.shouyiLibrary.product.dao") //接口包位置
public class MyBatisConfig {
    //引入分页插件
    @Bean
    public PaginationInterceptor mybatisPlusInterceptor() {
        PaginationInterceptor interceptor = new PaginationInterceptor();
        //设置请求页面大于最大页后,调回首页
        interceptor.setOverflow(true);
        //每页最大限制数,默认500
        interceptor.setLimit(1000);
        return interceptor;
    }


}
